package org.lboot.idmo.app.router;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.lboot.jpa.converter.JpaListStringConverter;
import org.lboot.jpa.entity.LongBaseEntity;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.List;

/**
 * 满足任一路由规则 即可放行
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "auth_app_route")
@ApiModel(value = "应用路由",description = "应用路由")
public class AuthAppRoute extends LongBaseEntity implements Serializable {
    @ApiModelProperty(value = "应用标识")
    @Column(name = "app_id")
    String appId;

    @ApiModelProperty(value = "应用名称")
    @Column(name = "app_name")
    String appName;

    @ApiModelProperty(value = "路由(支持正则)")
    @Column(name = "route")
    String route;

    @ApiModelProperty(value = "支持方法")
    @Column(name = "methods")
    @Convert(converter = JpaListStringConverter.class)
    List<String> methods;

    @ApiModelProperty(value = "优先级")
    @Column(name = "priority")
    Integer priority;
}
